<?php

defined( 'IN_DICE' ) or die( 'Access Error!' );

class table extends control {

  public function __construct() {
    
  }

  /**
   * 获取房间列表
   */
  public function getall( $req ) {
    $this->auth( $req, 0 );
    if( $this->check != 1 ) { return $this->genRes(); }
    list( $ttype ) = $this->param;

    $ret[0] = $ttype;
    $aT = model::table()->getmulti( $ttype );
    foreach ( $aT as $k => $v ) {
      if($v['tstatus'] == 0) {
        $ret[] = array(
            $v['tid'],    //桌子ID
            $v['ttype'],  //桌子类型
            $v['svid'],   //桌子对应的服务器ID
            $v['tviewer'],//旁观人数
            $v['tplayer'],//在玩人数
            $v['tminbet'],//最小下注
            //$v[''],
        );
      }
    }
    $this->error = 1;
    return $this->genRes( $ret );
  }

}
